Skip to content

[Master] - Bug 641309: Sustainability - Use specific carbon tracking for item reclassification#9517

Closed
v-rohangarg20 wants to merge 3 commits into
mainfrom
bugs/Bug-641309-Use-specific-carbon-tracking-for-item-reclassification
Closed

[Master] - Bug 641309: Sustainability - Use specific carbon tracking for item reclassification#9517
v-rohangarg20 wants to merge 3 commits into
mainfrom
bugs/Bug-641309-Use-specific-carbon-tracking-for-item-reclassification

Conversation

@v-rohangarg20

@v-rohangarg20 v-rohangarg20 commented Jul 15, 2026

Copy link
Copy Markdown

Workitem Bug 641309: [master] [Sustainability][Value Chain] Item Reclassification (location move) uses average emissions instead of Specific carbon tracking (lot/serial)

Fixes AB#641309

Issue: When an item uses Carbon Tracking Method = Specific, an Item Reclassification that moves the item to another location transferred the cost correctly (per the tracked lots/serials) but the emissions were calculated from an averaged CO2e per Unit × Quantity, ignoring the specific per-lot/serial CO2e.

Cause: In GetTotalCO2eAmount (SustainabilityPostMgt), Transfer entries short-circuited and set TotalCO2e := Abs(CO2ePerUnit * Quantity) using the averaged CO2e per unit, exiting before consulting the applied source entries that hold the specific lot/serial CO2e.

Solution: In GetTotalCO2eAmount, run the applied-entries lookup first and, for Transfer entries, derive TotalCO2e from the specific applied CO2e (AppliedAmount / AppliedQuantity × Quantity), falling back to the averaged CO2e per unit only when no specific applied data exists. Emissions now follow the moved lots/serials, mirroring how cost is transferred.

@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Jul 15, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 15, 2026
@JesperSchulz JesperSchulz added the Finance GitHub request for Finance area label Jul 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Stale Status Check Deleted

The Pull Request Build workflow run for this PR was older than 72 hours and has been deleted.

📋 Why was it deleted?

Status checks that are too old may no longer reflect the current state of the target branch. To ensure this PR is validated against the latest code and passes up-to-date checks, a fresh build is required.


🔄 How to trigger a new status check:

  1. 📤 Push a new commit to the PR branch, or
  2. 🔁 Close and reopen the PR

This will automatically trigger a new Pull Request Build workflow run.

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Stale Status Check Deleted

The Pull Request Build workflow run for this PR was older than 72 hours and has been deleted.

📋 Why was it deleted?

Status checks that are too old may no longer reflect the current state of the target branch. To ensure this PR is validated against the latest code and passes up-to-date checks, a fresh build is required.


🔄 How to trigger a new status check:

  1. 📤 Push a new commit to the PR branch, or
  2. 🔁 Close and reopen the PR

This will automatically trigger a new Pull Request Build workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants